package cn.darkhorse.pick.service.impl;

import java.util.List;

import cn.darkhorse.pick.pojo.PickDeviceWarninfo;
import cn.darkhorse.pick.mapper.PickDeviceWarninfoMapper;
import cn.darkhorse.pick.service.IPickDeviceWarninfoService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

/**
 * 采棉机预警信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-08-16
 */
@Service
public class PickDeviceWarninfoServiceImpl implements IPickDeviceWarninfoService
{
    @Autowired
    private PickDeviceWarninfoMapper pickDeviceWarninfoMapper;

    /**
     * 查询采棉机预警信息
     *
     * @param id 采棉机预警信息ID
     * @return 采棉机预警信息
     */
    @Override
    public PickDeviceWarninfo selectPickDeviceWarninfoById(Long id)
    {
        return pickDeviceWarninfoMapper.selectPickDeviceWarninfoById(id);
    }

    /**
     * 查询采棉机预警信息列表
     *
     * @param pickDeviceWarninfo 采棉机预警信息
     * @return 采棉机预警信息
     */
    @Override
    public List<PickDeviceWarninfo> selectPickDeviceWarninfoList(PickDeviceWarninfo pickDeviceWarninfo)
    {
        return pickDeviceWarninfoMapper.selectPickDeviceWarninfoList(pickDeviceWarninfo);
    }

    /**
     * 新增采棉机预警信息
     *
     * @param pickDeviceWarninfo 采棉机预警信息
     * @return 结果
     */
    @Override
    public int insertPickDeviceWarninfo(PickDeviceWarninfo pickDeviceWarninfo)
    {
        pickDeviceWarninfo.setCreateTime(DateUtils.getNowDate());
        return pickDeviceWarninfoMapper.insertPickDeviceWarninfo(pickDeviceWarninfo);
    }

    /**
     * 修改采棉机预警信息
     *
     * @param pickDeviceWarninfo 采棉机预警信息
     * @return 结果
     */
    @Override
    public int updatePickDeviceWarninfo(PickDeviceWarninfo pickDeviceWarninfo)
    {
        pickDeviceWarninfo.setUpdateTime(DateUtils.getNowDate());
        return pickDeviceWarninfoMapper.updatePickDeviceWarninfo(pickDeviceWarninfo);
    }

    /**
     * 删除采棉机预警信息对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deletePickDeviceWarninfoByIds(String ids)
    {
        return pickDeviceWarninfoMapper.deletePickDeviceWarninfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除采棉机预警信息信息
     *
     * @param id 采棉机预警信息ID
     * @return 结果
     */
    @Override
    public int deletePickDeviceWarninfoById(Long id)
    {
        return pickDeviceWarninfoMapper.deletePickDeviceWarninfoById(id);
    }
}
